import 'package:enterprise_v6_app/app/core/core.dart';

///标题-内容显示(带钉)
class CustomTitleContentView extends StatelessWidget {
  const CustomTitleContentView(
      {required this.title, required this.content, super.key, this.titleEdgeInsets, this.contentEdgeInsets, this.isShow=true});

  final bool isShow; //
  final Widget title; //上分显示的标题
  final Widget content; //下方显示的内容
  final EdgeInsetsGeometry? titleEdgeInsets; //标题边距
  final EdgeInsetsGeometry? contentEdgeInsets; //内容边距

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          padding: titleEdgeInsets ?? EdgeInsets.only(left: 12.w, right: 12.w, top: 11.w),
          decoration: BoxDecoration(
              color: Colors.white,
              borderRadius: BorderRadius.only(topRight: Radius.circular(6.w), topLeft: Radius.circular(6.w))),
          alignment: Alignment.center,
          child: title,
        ),
        Visibility(
            visible: isShow,
            child: Column(
              children: [
                SizedBox(
                  height: 35.w,
                  child: Stack(
                    children: [
                      Align(
                          alignment: const Alignment(-1, -1),
                          child: Container(
                            height: 15.w,
                            decoration: BoxDecoration(
                                color: Colors.white,
                                borderRadius: BorderRadius.only(
                                    bottomRight: Radius.circular(6.w), bottomLeft: Radius.circular(6.w))),
                            alignment: Alignment.center,
                          )),
                      Align(
                          alignment: const Alignment(0, -1),
                          child: Container(
                            height: 10.w,
                            decoration: BoxDecoration(
                                color: Colors.white,
                                borderRadius: BorderRadius.only(
                                    bottomRight: Radius.circular(6.w), bottomLeft: Radius.circular(6.w))),
                            alignment: Alignment.center,
                          )),
                      Align(
                          alignment: const Alignment(0, 1),
                          child: Container(
                            height: 15.w,
                            decoration: BoxDecoration(
                                color: Colors.white,
                                borderRadius: BorderRadius.only(
                                    topLeft: Radius.circular(6.w), topRight: Radius.circular(6.w))),
                            alignment: Alignment.center,
                          )),
                      Align(
                          alignment: const Alignment(-0.85, 0),
                          child: SvgPicture.asset(
                            AppImages.icon_nail,
                            width: 18.w,
                            height: 21.w,
                          )),
                      Align(
                          alignment: const Alignment(0.85, 0),
                          child: SvgPicture.asset(
                            AppImages.icon_nail,
                            width: 18.w,
                            height: 21.w,
                          )),
                    ],
                  ),
                ),
                Container(
                  padding: contentEdgeInsets ?? EdgeInsets.only(left: 12.w, right: 12.w, bottom: 11.w),
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.only(
                          bottomLeft: Radius.circular(6.w), bottomRight: Radius.circular(6.w))),
                  alignment: Alignment.center,
                  child: content,
                ),
              ],
            ))
      ],
    );
  }
}
